<?php
namespace app\index\model;

use think\Model;

class Menu extends Model{
    public function List($status){
        $data= $this->alias('m')
                    ->join('rm','m.Id = rm.m_Id')
                    ->where('rm.status',$status)
                    ->select();
        //dump($this->getLastSql());
        return $data;
    }
    public function cmenu(){
        $data = $this->hasMany('menu','parentId','m_Id');
        //dump($data);
        return $data;
    }
}

?>